package chapter7;

/**
 * Created by lenovo on 2016/3/22.
 */
public class Seaplane implements Swimmer,Flyer {
    private String name;
    public  Seaplane(String name){
        this.name=name;
    }
    public String getName(){
        return name;
    }
    @Override
    public  void swim(){
        System.out.printf("海上飞机 %s 航行海面%n",name);
    }
    @Override
    public  void fly(){
        System.out.printf("海上飞机 %s 在飞%n",name);
    }
}


class Seaplane1 extends Airplane implements Swimmer {
    public Seaplane1(String name){
        super(name);
    }

    @Override
    public  void swim(){
        System.out.printf("海上飞机 %s 航行海面%n",name);
    }
    @Override
    public  void fly(){
        System.out.printf("海上");
        super.fly();
    }
}
